home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!xlink.net!rz.uni-karlsruhe.de!stepsun.uni-kl.de!uklirb.informatik.uni-kl.de!feck
- From: feck@informatik.uni-kl.de (Christoph Feck IRZ)
- Subject: Re: BOOPSI Class Names
- Message-ID: <1994May9.143931@informatik.uni-kl.de>
- Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
- Nntp-Posting-Host: uklira.informatik.uni-kl.de
- Organization: University of Kaiserslautern, Germany
- References: <2pu92s$mh7@lovelady.cs.utexas.edu> <CpFuCu.4qx@news.ci.ua.pt> <2qh5nu$mhs@priddy.cs.utexas.edu> <1994May8.165619@informatik.uni-kl.de> <2qjff0$r3m@priddy.cs.utexas.edu>
- Date: Mon, 9 May 1994 12:39:31 GMT
- Lines: 37
-
- In article <2qjff0$r3m@priddy.cs.utexas.edu>, mthomas@cs.utexas.edu (Mark A. Thomas) writes:
- > In article <1994May8.165619@informatik.uni-kl.de>,
- > Christoph Feck IRZ <feck@informatik.uni-kl.de> wrote:
- > >The solution is simple: Make your library have _one_ LVO (let's
- > >call it GetClass() here).
- >
- > Yes, this is a nice solution... The only reason that I can come up
- > with for this not being the best solution is that it will take 3
- > steps to get a gadget (OpenClass(), GetClass(), and CreateObject()),
- > as opposed to 2 (OpenClass(), CreateObject()). However it does have
- > the advantage of not having to wait for Commodore to approve of a
- > public class name. I guess I'll use this now, and when I get
- > approval I'll let you do it either way. Thanks.
-
- There is another reason: Speed! Say you want to create 100
- button objects in your window, the OS would search 100 times
- the public class list. When more and more people add classes
- to this list, the startup time of your program increases
- proportional to O(n*m). But if you already have a class pointer
- (_AND_ it is guarantueed to stay valid as long as the library
- is openend), you can just do a simple CoerceMethod call:
-
- newobj = CoerceMethod(class, class, OM_NEW, attributes);
-
- This directly jumps into the class dispatcher. The only
- reason the Intuition call NewObjectA exists, is because
- of locking the class to prevent it from unloading while
- the object is being created (semaphores et al.).
-
- > Yes, certainly. My goal was to always follow the Commodore
- > standard, that's why I'm a bit hesitant about GetClass().
-
- Actually, datatype classes also have this LVO at offset -30.
- That's where I got the idea :)
-
- 3k// Christoph Feck, TowerSystems - BOOPSI Class Development
- \X/ Amiga - Intuition inside.
-